package com.decelo.jpa.service.Impl;

import com.decelo.jpa.dao.ClassesDao;
import com.decelo.jpa.entity.sys.Classes;
import com.decelo.jpa.service.ClassesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CachePut;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@CacheConfig(cacheNames={"dev"})
public class ClassesServiceImpl implements ClassesService {
    @Autowired
    private ClassesDao classesDao;
    @Transactional
    @Override
    @CachePut(key="#classes")
    public boolean edit(Classes classes) {
        Classes newclasses = classesDao.saveAndFlush(classes);
        return newclasses!=null?true:false;
    }
    //@CacheEvict(key = "#p0") delete
}
